/*
#################################################################
# "Democracy, Inequality and Antitrust"                         #
#   By Michael O Allen, Kenneth Scheve, and David Stasavage     #
#                                                               #
#   This file:                                                  #
#   Replication code for Table 2 						        #
#                                                               #
#   Last modified: 12/18/2024                                   #
#################################################################
*/

cd "/Users/moda/Desktop/democracy inequality antitrust jop"
use "data/clayton_votes.dta", clear

// Recode so the main explanatory varible equals 1 when the Senator
// 		was originally SELECTED into office, not popularly elected.
gen oe_flipped = .
replace oe_flipped = 1 if oe == 0
replace oe_flipped = 0 if oe == 1

label variable oe "Originally elected"
label variable oe_flipped "Originally selected"
label variable top1Share_ln "ln Top 1\% Inc. Share\textsubscript{1917}"
label variable manufac_ln "ln Manufac. Prod."
label variable democrat "Democrat"

qui eststo probit_m1: probit vote oe_flipped, robust
qui eststo probit_m2: probit vote top1Share_ln, robust
qui eststo probit_m3: probit vote oe_flipped top1Share_ln, robust
qui eststo probit_m4: probit vote oe_flipped top1Share_ln manufac_ln, robust
qui eststo probit_m5: probit vote oe_flipped top1Share_ln manufac_ln democrat, robust


use "data/webb_votes.dta", clear

gen oe_flipped = .
replace oe_flipped = 1 if oe == 0
replace oe_flipped = 0 if oe == 1

label variable oe "Originally elected"
label variable oe_flipped "Originally selected"
label variable top1Share_ln "ln Top 1\% Inc. Share\textsubscript{1917}"
label variable manufac_ln "ln Manufac. Prod."
label variable democrat "Democrat"

qui eststo probit_m6: probit vote oe_flipped, robust
qui eststo probit_m7: probit vote top1Share_ln, robust
qui eststo probit_m8: probit vote oe_flipped top1Share_ln, robust
qui eststo probit_m9: probit vote oe_flipped top1Share_ln manufac_ln, robust
qui eststo probit_m10: probit vote oe_flipped top1Share_ln manufac_ln democrat, robust

esttab  probit_m1 probit_m2 probit_m3 probit_m4 probit_m5 ///
	using "output/tables/table-2a.tex", /// 
	s(N ll, label("Observations" "Log-likelihood")) label /// 
	star(* .1 ** .05 *** .01) b(2) se(2) booktabs compress ///
	drop(_cons) noomitted  ///
	nomtitles nogap replace
	
esttab probit_m6 probit_m7 probit_m8 probit_m9 probit_m10 ///
	using "output/tables/table-2b.tex", /// 
	s(N ll, label("Observations" "Log-likelihood")) label /// 
	star(* .1 ** .05 *** .01) b(2) se(2) booktabs compress ///
	drop(_cons) noomitted  ///
	nomtitles nogap replace
